
# 查找串口

python lerobot/scripts/find_motors_bus_port.py

sudo chmod 666 /dev/ttyACM2
sudo chmod 666 /dev/ttyACM3

# 采集数据

python lerobot/scripts/control_robot.py \
  --robot.type=so101 \
  --control.type=record \
  --control.fps=30 \
  --control.single_task="Grab a component and place it inside the white circle." \
  --control.repo_id=nzd/so101_test \
  --control.tags='["so101","tutorial"]' \
  --control.warmup_time_s=5 \
  --control.episode_time_s=30 \
  --control.reset_time_s=30 \
  --control.num_episodes=2 \
  --control.display_data=true \
  --control.push_to_hub=false

# 可视化数据

python lerobot/scripts/visualize_dataset_html.py \
  --repo-id nzd/so101_test

# 复刻数据
python lerobot/scripts/control_robot.py \
  --robot.type=so101 \
  --control.type=replay \
  --control.fps=30 \
  --control.repo_id=nzd/so101_test \
  --control.episode=0

# 训练模型

python lerobot/scripts/train.py \
  --dataset.repo_id=nzd/so101_test \
  --policy.type=act \
  --output_dir=outputs/train/act_so101_test \
  --job_name=act_so101_test \
  --policy.device=cuda \
  --wandb.enable=false \
  --num_workers 0

python lerobot/scripts/train.py \
  --dataset.repo_id=nzd/so101_test \
  --policy.type=diffusion \
  --output_dir=outputs/train/diffusion_so101_test \
  --job_name=diffusion_so101_test \
  --policy.device=cuda \
  --wandb.enable=false \
  --num_workers 0


# 推理模型

python lerobot/scripts/control_robot.py \
  --robot.type=so101 \
  --control.type=record \
  --control.fps=30 \
  --control.single_task="Grab a component and place it inside the white circle." \
  --control.repo_id=nzd/eval_so101_test \
  --control.tags='["tutorial"]' \
  --control.warmup_time_s=5 \
  --control.episode_time_s=30 \
  --control.reset_time_s=30 \
  --control.num_episodes=10 \
  --control.push_to_hub=false \
  --control.policy.path=outputs/train/act_so101_test/checkpoints/last/pretrained_model

python lerobot/scripts/control_robot.py \
  --robot.type=so101 \
  --control.type=record \
  --control.fps=30 \
  --control.single_task="Grab a component and place it inside the white circle." \
  --control.repo_id=nzd/eval_so101_test \
  --control.tags='["tutorial"]' \
  --control.warmup_time_s=5 \
  --control.episode_time_s=30 \
  --control.reset_time_s=30 \
  --control.num_episodes=10 \
  --control.push_to_hub=false \
  --control.policy.path=outputs/train/diffusion_so101_test/checkpoints/last/pretrained_model